<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <style>
        .b{
            height: 100px;
            width: 100px;
            border: 1px solid black;
            text-align: center;
            line-height: 100px;
            cursor: pointer;
        }
        .y{
            background-color: yellow;
        }
        .s{
            color: orange;
        }
        .d{
            font-size: 20px;
        }
        .k{
            font-weight: 600;
        }
    </style>
</head>
<body>

    <div id="root">
        <!-- 变化的样式用绑定的形式写 -->
        <!-- 绑定样式三种，直接绑定，数组绑定，对象绑定 -->
       <div class="b" @click = 'changeBg' :class=[a,c] :style = 'styleObj'>
        {{name}}
       </div>
    </div>
</body>
<script>
    Vue.config.productionTip = false;
    const vm = new Vue({
        el:'#root',
        data:{
           name:'张傲',
           a:['y','s'],
           c:{
               d:true,
               k:false
           },
        //    用style绑定样式要写成一个对象，而且要去掉-，换成驼峰形式，你绑定多个也可以像这样:class=[a,c]
           styleObj:{
               fontSize:'60px',
               
           }
        },
        methods:{
            changeBg(){
                console.log("多的")
            }
        }
    })
</script>
</html>